/*
 * Copyright (c) [2019] Zhang Yansen.All rights reserved.
 *
 * xrc-form2 is licensed under the Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *
 *     http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

export function hasOwnProperty(o, p) {
  return Object.prototype.hasOwnProperty.call(o, p);
}

export function isFunction(fn) {
  return typeof fn === 'function'
}

export function isBoolean(b) {
  return typeof b === 'boolean'
}

export function isEmpty(t) {
  if (t === undefined || t === null) {
    return true
  }

  if (typeof t === 'object') {
    return !Object.keys(t).length
  }
  
  if (Array.isArray(t)) {
    return t.length
  }

  return false
}

export function noop() {}
